package internal

import (
	"github.com/name5566/leaf/module"
	"talent.com/agency_im/conf/g"
	"talent.com/server/durotar.git/leaf"
)

var (
	skeleton = leaf.NewSkeleton()
	ChanRPC  = skeleton.ChanRPCServer
)

type Module struct {
	*module.Skeleton
}

func (m *Module) OnInit() {
	m.Skeleton = skeleton

	skeleton.AfterFunc(g.ClearIdleAgentsCycle, clearIdleAgents)
	skeleton.AfterFunc(g.ExpireSubscribersCycle, expireSubscribers)
	skeleton.AfterFunc(g.ClearLeavingCycle, clearLeavingAgents)
	skeleton.AfterFunc(g.CheckUnRepliedCycle, unRepliedMsgWarning)
}

func (m *Module) OnDestroy() {
	// TODO
}
